
package com.shop.cloud.mall.api.controller;

import com.shop.cloud.common.core.constant.SecurityConstants;
import com.shop.cloud.common.core.util.R;
import com.shop.cloud.upms.common.feign.FeignAgreementConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 协议管理
 *
 * @author
 * @date 2024-03-19 15:24:21
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/agreementconfig")
@Tag(description = "agreementconfig", name = "协议API")
public class AgreementConfigController {

    private final FeignAgreementConfigService feignAgreementConfigService;
    /**
     * 通过类型查询会员协议
     * @param type
     * @return
     */
    @Operation(summary = "通过类型查询会员协议")
    @GetMapping("/{type}")
    public R getByType(@PathVariable("type") String type) {
        return R.ok(feignAgreementConfigService.getByType(type, SecurityConstants.FROM_IN));
    }
}
